package thread;

import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) {
        System.out.println("程序开始,请输入开始时间：");
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        System.out.println("开始倒计时");
        for (int i = num; i >0; i--){
            System.out.println(i);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        System.out.println("0");
        System.out.println("倒计时结束");
    }
}
